package cronjob

import (
	"fmt"
	"gin-mini-agent/pkg/global"
	"runtime/debug"
	"time"
)

// 清理超过一周的日志表数据
type CleanLog struct {
}

func (u CleanLog) Run() {
	startTime := time.Now()
	global.Log.Debug(fmt.Sprintf("cronjob定时任务:CleanLog开始执行 %s", startTime.Format("2006-01-02 15:04:05")))
	defer func() {
		if panicErr := recover(); panicErr != nil {
			global.Log.Error(fmt.Sprintf("cronjob定时任务:CleanLog执行失败: %v\n堆栈信息: %v", panicErr, string(debug.Stack())))
		}
	}()

}
